package com.yuhong.springbootinit.model.vo;

import com.yuhong.springbootinit.model.entity.Invitation;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 帖子视图
 *
 * @author 任玉洪</a>

 */
@Data
public class InvitationVO implements Serializable {


    private Long id;
    /**
     *
     */
    private String hrId;

    /**
     *
     */
    private String hrName;

    /**
     *
     */
    private String userName;

    /**
     *
     */
    private String companyId;

    /**
     * 职位名称
     */
    private String title;

    /**
     *
     */
    private String positionId;


    private String positionName;

    /**
     *
     */
    private String companyName;


    /**
     * 邀约状态 初始化0 用户同意1 用户拒绝2 hr撤回3
     */
    private Integer status;


    private Date createTime;

    /**
     * 包装类转对象
     *
     * @param postVO
     * @return
     */
//    public static Post voToObj(PositionVO postVO) {
//        if (postVO == null) {
//            return null;
//        }
//        Post post = new Post();
//        BeanUtils.copyProperties(postVO, post);
//        List<String> tagList = postVO.getTagList();
//        post.setTags(JSONUtil.toJsonStr(tagList));
//        return post;
//    }

    /**
     * 对象转包装类
     *
     * @param invitation
     * @return
     */
    public static InvitationVO objToVo(Invitation invitation){
        if (invitation == null) {
            return null;
        }
        InvitationVO invitationVO = new InvitationVO();
        BeanUtils.copyProperties(invitation, invitationVO);

        return invitationVO;
    }
}
